package com.vote.common.constant;

/**
 * @author gyg
 * @version V1.0.0
 * @description: Redis相关Key汇总
 * @date 2021/05/20 10:32
 */
public class RedisConstants {

    public static final String COMMON_PREFIX_USER = "vote:user:";
    public static final String COMMON_PREFIX_ADMIN = "vote:admin:";

    public static class Key {


        /**
         * 投票人ip
         */
        private static String VOTE_USER_IP = COMMON_PREFIX_USER + "vote_user_ip_%s";
        public static String getVoteUserIp(String ip) {
            return String.format(VOTE_USER_IP, ip);
        }

        /**
         * 投票人id
         */
        private static String VOTE_USER_ID = COMMON_PREFIX_USER + "vote_user_id_%s";
        public static String getVoteUserId(Integer id) {
            return String.format(VOTE_USER_ID, id);
        }


        /**
         * 普通管理员菜单列表
         */
        public static final String ADMIN_MENU = COMMON_PREFIX_ADMIN + "admin_menu";

        /**
         * 超级管理员菜单列表
         */
        public static final String SUPER_ADMIN_MENU = COMMON_PREFIX_ADMIN + "super_admin_menu";
    }

}
